import { judgeType } from "@/utils/judge";

const mapToList = (map: any, type?: string) => {
  const list: any = [];

  for (const key in map) {
    const item = {
      label: map[key],
      // value: isNaN(Number(key)) ? key : Number(key),
      value: judgeType("number", Number(key)) && !isNaN(Number(key)) ? Number(key) : key,
    };
    list.push(item);
  }
  return list;
};

export const isNotMap = {
  1: "是",
  0: "否",
};
export const isNotList = mapToList(isNotMap);

export const enableMap = {
  1: "正常",
  0: "禁用",
};
export const enableList = mapToList(enableMap);

export const successMap = {
  1: "成功",
  0: "失败",
};
export const successList = mapToList(successMap);

export const businessStatusMap = {
  1: "正常",
  2: "停业",
  3: "注销",
};
export const businessStatusList = mapToList(businessStatusMap);

export const unitMap = {
  1: "元",
  2: "角",
  3: "分",
};
export const unitList = mapToList(unitMap);

export const payMap = {
  1: "微信",
  2: "支付宝",
  3: "网银",
};
export const payList = mapToList(payMap);

export const coordinateDealMethodsMap = {
  1: "统筹合同争议解决方式1",
  2: "统筹合同争议解决方式2",
  3: "统筹合同争议解决方式3",
};
export const coordinateDealMethodsList = mapToList(coordinateDealMethodsMap);

export const certTypeMap = {
  身份证: "身份证",
  军官证: "官证",
  护照: "护照",
};
export const certTypeList = mapToList(certTypeMap);

export const relationshipMap = {
  1: "统筹人关系1",
  2: "统筹人关系2",
  3: "统筹人关系3",
};
export const relationshipList = mapToList(relationshipMap);

export const roleScopeMap = {
  1: "全局角色",
  2: "内部角色(部门)",
  3: "销售角色",
};
export const roleScopeList = mapToList(roleScopeMap);

export const roleDataScopeMap = {
  1: "全部",
  2: "部门及子部门",
  3: "本部门",
  4: "本人",
};
export const roleDataScopeList = mapToList(roleDataScopeMap);

export const userTypeMap = {
  1: "内部员工",
  2: "销售人员",
};
export const userTypeList = mapToList(userTypeMap);

export const terminalTypeMap = {
  1: "能看所有",
  2: "根据出单人显示",
};
export const terminalTypeList = mapToList(terminalTypeMap);

export const genderMap = {
  0: "未知",
  1: "男",
  2: "女",
};
export const genderList = mapToList(genderMap);

export const bankAccountTypeMap = {
  0: "个人账户",
  1: "企业账户",
};
export const bankAccountTypeList = mapToList(bankAccountTypeMap);

export const salespersonStatusMap = {
  0: "待审核",
  1: "未通过审核",
  2: "通过审核",
};
export const salespersonStatusList = mapToList(salespersonStatusMap);

export const salespersonTypeMap = {
  0: "销售人员类型1",
  1: "销售人员类型2",
  2: "销售人员类型3",
};
export const salespersonTypeList = mapToList(salespersonTypeMap);

export const caseTypeMap = {
  案件状态1: "案件状态1",
  案件状态2: "案件状态2",
  案件状态3: "案件状态3",
};
export const caseTypeList = mapToList(caseTypeMap);

export const progressTypeMap = {
  进展状态1: "进展状态1",
  进展状态2: "进展状态2",
  进展状态3: "进展状态3",
};
export const progressTypeList = mapToList(progressTypeMap);

export const ethnicityMap = {
  汉族: "汉族",
  蒙古族: "蒙古族",
  回族: "回族",
  藏族: "藏族",
  维吾尔族: "维吾尔族",
  苗族: "苗族",
  彝族: "彝族",
  壮族: "壮族",
  布依族: "布依族",
  朝鲜族: "朝鲜族",
  满族: "满族",
  侗族: "侗族",
  瑶族: "瑶族",
  白族: "白族",
  土家族: "土家族",
  哈尼族: "哈尼族",
  哈萨克族: "哈萨克族",
  傣族: "傣族",
  黎族: "黎族",
  傈僳族: "傈僳族",
  佤族: "佤族",
  畲族: "畲族",
  高山族: "高山族",
  拉祜族: "拉祜族",
  水族: "水族",
  东乡族: "东乡族",
  纳西族: "纳西族",
  景颇族: "景颇族",
  柯尔克孜族: "柯尔克孜族",
  土族: "土族",
  达斡尔族: "达斡尔族",
  仫佬族: "仫佬族",
  羌族: "羌族",
  布朗族: "布朗族",
  撒拉族: "撒拉族",
  毛难族: "毛难族",
  仡佬族: "仡佬族",
  锡伯族: "锡伯族",
  阿昌族: "阿昌族",
  普米族: "普米族",
  塔吉克族: "塔吉克族",
  怒族: "怒族",
  乌孜别克族: "乌孜别克族",
  俄罗斯族: "俄罗斯族",
  鄂温克族: "鄂温克族",
  崩龙族: "崩龙族",
  保安族: "保安族",
  裕固族: "裕固族",
  京族: "京族",
  塔塔尔族: "塔塔尔族",
  独龙族: "独龙族",
  鄂伦春族: "鄂伦春族",
  赫哲族: "赫哲族",
  门巴族: "门巴族",
  珞巴族: "珞巴族",
  基诺族: "基诺族",
};
export const ethnicityList = mapToList(ethnicityMap);

export const itemTypeMap = {
  1: "项目类型1",
  2: "项目类型2",
  3: "项目类型3",
};
export const itemTypeList = mapToList(itemTypeMap);

// 账户类型：COMPANY对公、PERSONAL对私
export const accountTypeMap = {
  COMPANY: "对公",
  PERSONAL: "对私",
};
export const accountTypeList = mapToList(accountTypeMap);

// 开票类别：1：个人，2：企业
export const invoiceCategoryMap = {
  1: "个人",
  2: "企业",
};
export const invoiceCategoryList = mapToList(invoiceCategoryMap);

export const invoiceTypeMap = {
  1: "增值税普通发票",
  2: "增值税电子普通发票",
  3: "增值税专用发票",
  4: "增值税电子专用发票",
};
export const invoiceTypeList = mapToList(invoiceTypeMap);
